﻿/************************************************************************************
* Copyright (c) 2019 All Rights Reserved.
*命名空间：Merge.Model
*文件名： ClassMathModel
*创建人： Liebeskind
*创建时间：2019/6/20 17:49:30
*描述
*=====================================================================
*修改标记
*修改时间：2019/6/20 17:49:30
*修改人：Liebeskind
*描述：有限集用枚举，“无限”和可扩充的集合不定义大小
************************************************************************************/

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using MathNet.Numerics.LinearAlgebra.Double;

namespace Merge.Model.Classify
{
    /// <summary>
    /// 定义特征向量变量n=4
    /// </summary>
    public struct Eigenvector
    {
        public LINE LINEi;
        /// <summary>
        /// 必要特征不能为""(NULL)
        /// </summary>
        public string PN;
        public KCAndBF KCAndBF;
        public Remark Remark;

        /// <summary>
        /// 特征向量(矩阵形式)
        /// </summary>
        public DenseMatrix MEigenvector;
    }
    public class CEigenvector
    {
        public LINE LINEi { get; set; }
        /// <summary>
        /// 必要特征不能为""(NULL)
        /// </summary>
        public string PN { get; set; }
        public KCAndBF KCAndBF { get; set; }
        public Remark Remark { get; set; }

        /// <summary>
        /// 特征向量(矩阵形式)
        /// </summary>
        public DenseMatrix MEigenvector;
        /// <summary>
        /// 特征向量字符格式
        /// </summary>
        public string StringEigenvector { get; set; }

        public CEigenvector(LINE LINEi, string PN, KCAndBF KCAndBF, Remark Remark, DenseMatrix MEigenvector)
        {
            this.LINEi = LINEi;
            this.PN = PN;
            this.KCAndBF = KCAndBF;
            this.Remark = Remark;
            this.MEigenvector = MEigenvector;

            StringEigenvector = (int)LINEi + "," + MEigenvector.SubMatrix(1,1,0,1).Determinant() + "," + (int)KCAndBF + "," + (int)Remark;
        }


    }

    /// <summary>
    /// Remark值域
    /// </summary>
    public enum Remark
    {
        /// <summary>
        /// 空集，Remark是类型的可选特征，若为ZERO则此类型不考虑方别向上的投影，全局中只存在不考虑Remark和考虑全体Remark值域两种情况
        /// </summary>
        ZERO = 0,
        ANSI = 1,
        ISO = 2,
        JIS = 3
    }
    /// <summary>
    /// KC+BF值域
    /// </summary>
    public enum KCAndBF
    {
        /// <summary>
        /// 空集，KC+BF作为毕业特征不能置NULL
        /// </summary>
        ZERO = 0,
        One = 1,
        Two = 2,
        Three = 3,
        Four = 4
    }
    public enum LINE
    {
        /// <summary>
        /// 空集，线别是类型的可选特征，若为NULL则此类型不考虑方别向上的投影，在类型集合中必须存在含有此特征值的类
        /// </summary>
        ZERO = 0,
        TB1_1FT_01 = 1,
        TB1_1FT_02 = 2,
        TB1_1FT_03 = 3,
        TB1_1FT_04 = 4,
        TB1_1FT_05 = 5,
        TB1_1FT_06 = 6,
        TB1_1FT_07 = 7,
        TB1_1FT_08 = 8,
        TB1_1FT_09 = 9,
        TB1_1FT_10 = 10,
        TB1_1FT_11 = 11,
        TB1_1FT_12 = 12,
        TB1_1FT_13 = 13,
        TB1_1FT_14 = 14,
        TB1_1FT_15 = 15,
        TB1_1FT_16 = 16
    }

}
